IF EXISTS (SELECT * FROM sysobjects WHERE type = 'V' AND name = 'VW_WebsiteFetch')
	BEGIN
		DROP  View VW_WebsiteFetch
	END
GO

CREATE View VW_WebsiteFetch AS

SELECT
	w.WebsiteId, w.ServiceId, w.Guid, s.AccountId,
	a.Title AS AccountTitle, s.Title, s.CreateDate, s.UpdateDate
FROM Websites AS w
INNER JOIN Services AS s ON w.ServiceId = s.ServiceId
INNER JOIN Accounts AS a ON s.AccountId = a.AccountId

GO